<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="app">
<h1>{{msg}}</h1>
    <table border="1px" width="100px">
        <tr>
            <td>名字</td>
            <td>年龄</td>
        </tr>
        <tr v-for="monster in monsterList">
            <td>{{monster.name}}</td>
            <td>{{monster.age}}</td>
        </tr>
    </table>
</div>
</body>
<script src="vue.js"></script>
<script src="axios.min.js"></script>
<script>
  let vm=new Vue({
    el:"#app",
    data:{
        msg:"妖怪列表",
      monsterList:[]
    },
    methods:{
        //list()函数在生命周期函数created中使用
        list(){
            axios.get("http://localhost:63342/axios/data/response.data.json")
                .then((responseData)=>{
                    // console.log("responseData",responseData)
                    console.log("responseData.data.data.items",responseData.data.data.items);
                    this.monsterList=responseData.data.data.items
                    //可以再次发出ajax请求
                    //return axios.get("...")
                })//.then((responseData)=>{...})
                .catch((err)=>{
                    console.log("异常=",err)
                })
        }
    },
      created(){
        this.list()
      }
  })
</script>
</html>